package cn.dyp.com.changelanguage.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import cn.dyp.com.changelanguage.activity.MainActivity;

/**
 * 自定义广播类 语言改变后重启Activity
 *
 */
public class ChangeReceiver extends BroadcastReceiver {
    private Intent mIntent;

    @Override
    public void onReceive(Context context, Intent intent) {
            mIntent = new Intent(context, MainActivity.class);
            //设置此标志使activity将成为此历史堆栈上新任务的开始
            mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(mIntent);
        /*ndroid.os.Process.killProcess(android.os.Process.myPid());
        System.exit(0);*/
    }
}
